package com.csesteel.crm.service.impl;

import com.csesteel.crm.dao.UserDao;
import com.csesteel.crm.domain.User;
import com.csesteel.crm.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by Administrator on 2015/4/21 0021.
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Transactional
    public User getUserByNameAndPasswd(String name, String passwd) {
        return userDao.getUserByNameAndPassword(name, passwd);
    }

    @Transactional
    public void saveUser(User user) {
        userDao.save(user);

    }

    @Transactional
    public void deleteUser(String id) {
        userDao.deleteUserById(id);
    }
}
